package main

import (
	"fmt"
	_ "github.com/go-sql-driver/mysql"
	"netdisk/dao"
	"netdisk/routers"
)

func main() {
	err := dao.InitMySQL() //初始化数据库
	if err != nil {
		fmt.Printf("init mysql failed, err:%v\n", err)
		return
	}
	defer dao.Close()
	engine := routers.SetupRouter()
	if err := engine.Run(":8848"); err != nil {
		fmt.Printf("server startup failed, err:%v\n", err)
	}
}
